package com.csun.cmny.provider.model.dto.nursingRecords;

import com.csun.cmny.provider.validator.OmcMonitorLogValidator;
import lombok.Data;
import org.apache.ibatis.type.Alias;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Date;

@Data
public class NursingRecordsSaveDto {



    /*老人id*/
    @NotNull(message = "{nursingRecords.oldmanId.null}")
    private Long oldmanId;

    /*项目编号*/
    @NotEmpty(message = "{nursingRecords.no.null}")
    private String itemNo;

    /*护理人员*/
    @NotEmpty(message = "{nursingRecords.nurseName.null}")
    private String nurseName;

    /*护理项目*/
    @NotEmpty(message = "{nursingRecords.nursingProject.null}")
    private String nursingProject;

    /*项目类型*/
    @NotEmpty(message = "{nursingRecords.projectType.null}")
    private String projectType;

    /*开始时间*/
    @NotEmpty(message = "{nursingRecords.startDate.null}")
    @Size(min = 1, max = 10, message = "{Monitorlog.date.length.error}",groups = {OmcMonitorLogValidator.class})
    @Pattern(regexp="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])"
            + "|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|"
            + "[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$",
            message="{Advisory.date.pattem.error}")
    private String startDate;

    /*结束时间*/
    @NotEmpty(message = "{nursingRecords.endDate.null}")
    @Size(min = 1, max = 10, message = "{Monitorlog.date.length.error}",groups = {OmcMonitorLogValidator.class})
    @Pattern(regexp="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])"
            + "|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|"
            + "[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$",
            message="{Advisory.date.pattem.error}")
    private String endDate;

    /*单价(元/次)*/
    private float unitPrice;


    /*数量*/
    private Integer quantity;
}
